<template>
  <div class="page">
    <iframe :src="decodeSrc" frameborder="0" width="100%" id="bi-iframe" @load="adjustIframe"></iframe>
  </div>
</template>

<script>

export default {
  name: 'IframeView',
  data () {
    return {
      decodeSrc: ''
    }
  },
  beforeRouteUpdate (to, from, next) {
    console.log(2)
  },
  created () {
    this.$watch('$route', () => {
      this.adjustIframe()
    })
  },
  methods: {
    adjustIframe () {
      this.decodeSrc = decodeURIComponent(this.$route.fullPath.replace('/iframe/', ''))
    }
  }
}
</script>

<style lang="less" scoped>
.page {
  height: calc(100vh - 65px);
}
#bi-iframe {
  margin: 0;
  padding: 0;
  min-height: 99%;
  border: none;
}
</style>
